package com.wenjie.controller.sys;

import com.wenjie.original.entity.common.vo.RestBaseVo;
import com.wenjie.original.entity.vo.SysLogLogin.SysLogLoginUpOrAddVo;
import com.wenjie.original.entity.vo.SysLogLogin.SysLogLoginVo;
import com.wenjie.original.service.ISysLogLoginService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/sysLogLogin")
public class SysLogLoginController {

    @Autowired
    private ISysLogLoginService sysLogLoginService;

    @ApiOperation("查询接口")
    @PostMapping("/list")
    public RestBaseVo<SysLogLoginVo.ResVo> list(@RequestBody @Validated SysLogLoginVo.SelVo selVo) {
        return sysLogLoginService.list(selVo, SysLogLoginVo.ResVo.class);
    }

    @ApiOperation("添加接口")
    @PostMapping("/add")
    public void add(@RequestBody @Validated SysLogLoginUpOrAddVo.AddVo addVo) {
        sysLogLoginService.save(addVo);
    }

    @ApiOperation("修改接口")
    @PostMapping("/up")
    public void up(@RequestBody @Validated SysLogLoginUpOrAddVo.UpVo upVo) {
        sysLogLoginService.updateById(upVo);
    }


}
